<?php

class wms_finder_pickinglist
{

	var $column_edit = '操作';
	var $column_edit_width = "100";

    var $detail_pickinglist_delis = "审批明细";
    //var $detail_pickinglist_ax = "";
	public function column_edit($row)
	{
		$finder_id = $_GET['_finder']['finder_id'];
         $pickinglistMdl = app::get('wms')->model('pickinglist');
        $pickinglistMdl_datas= $pickinglistMdl->getList('status', array('id' => $row['id'] ),0,1);
        if($pickinglistMdl_datas[0]['status']!='confirmed')
        {
		  return '<a href="index.php?app=wms&ctl=admin_pickinglist&act=editpickinglist&id=' . $row['id'] . '&finder_id='.$finder_id.'" target="_blank">编辑</a>';
        }

	}

    /*
     * 备货通知单明细
     */
    function detail_pickinglist_delis($row)
    {
        $render = app::get('wms')->render();

        $pickinglist_line = app::get('wms')->model('pickinglist_line');
        $basicMaterialInfo = $pickinglist_line->getList('*', array('pickinglist_id' => $row));
        
        foreach ($basicMaterialInfo as $key => $value) 
        {
            $basicMaterialInfo[$key]['app_time'] =date('Y-m-d H:i',$value['app_time']);
            $cnts = unserialize($value['bnsContent']);
            $basicMaterialInfo[$key]['bnsContent']=implode(',',$cnts);
        }
        $render->pagedata['res'] = $basicMaterialInfo;
        return $render->fetch('admin/pickinglist/pickinglist_line.html');
    }

    /*
     * 备货通知单明细
     */
    // function detail_pickinglist_ax($row){
    //     $render = app::get('wms')->render();
    //     $pickinglist_delis = app::get('wms')->model('pickinglist_delis');
    //     $basicMaterialInfo = $pickinglist_delis->getList('*', array('pickinglist_id' => $row));
    //     $render->pagedata['res'] = $basicMaterialInfo;
    //     return $render->fetch('admin/pickinglist/pickinglist_ax.html');
    // }
}